package com.logistics.utils.socket;

import lombok.Data;

import javax.websocket.Session;

@Data
public class UserBean {

    private String userId;

    private Boolean isPhone;

    private DeviceSession pcSession;
    private DeviceSession phoneSession;

    public UserBean(String userId){
        this.userId = userId;
    }

    public void setPhoneSession(Session session, int device){
        if(session == null){
            this.phoneSession = null;
            return;
        }
        this.phoneSession = new DeviceSession(session, device);
    }

    public void setPcSession(Session session, int device){
        if(session == null){
            this.pcSession = null;
            return;
        }
        this.pcSession = new DeviceSession(session, device);
    }

}
